<?php
/**
 * Introduction: 会员中心
 * @author: 杨陈鹏
 * @email: wanglong@cdlinglu.com
 */

namespace WeChat\Controller\Member;


use Common\Controller\WeChat\SignController;

class IndexController extends SignController
{


    /**
     * Introduction: 修改会员信息
     * @author: 杨陈鹏
     * @email: wanglong@cdlinglu.com
     */
    public function update()
    {

        $data = I('post.data');

        //可修改的字段
        $fields = [
            'avatar',
            'nicname',
            'username',
            'autograph',
            'sex',
        ];

        foreach ($data as $k => $v)
        {

            if(in_array($k,$fields))
                $datas[$k] = $v;

        }

        $logic = D('Common/Member','Logic');

        outPut($logic::update($datas,self::$uid),true);

    }
    /**
     * Introduction: 会员登录之后修改密码
     * @author: 杨陈鹏
     * @email: wanglong@cdlinglu.com
     */
    public function updatePassword()
    {

        $data = I('post.data');

        $logic = D('Common/Member','Logic');

        outPut($logic::updatePassword($data,self::$uid),true);


    }

}